<!--<button class="btn btn-primary btn-sm" ng-click="addUser()">新增</button>-->
<div class="page-header">
  <strong class="page-header-title">用户</strong>
</div>
<table class="table table-bordered table-hover">
  <thead>
  <tr>
    <th class="col-xs-2">id</th>
    <th class="col-xs-2">手机</th>
    <th class="col-xs-2">工号</th>
    <th class="col-xs-2">姓名</th>
    <th class="col-xs-2">邮箱</th>
    <th class="col-xs-2 text-center">操作</th>
  </tr>
  </thead>
  <tbody>
  <tr ng-repeat="user in userList">
    <td>{{user.id}}</td>
    <td>{{user.mobile}}</td>
    <td>{{user.worker_num}}</td>
    <td>{{user.name}}</td>
    <td>{{user.email}}</td>
    <td class="text-center">
      <div class="btn-group btn-group-sm">
        <button class="btn btn-primary" ng-click="editUser(user.id, $index)">修改</button>
        <button class="btn btn-primary" ng-click="deleteUser(user.id)">删除</button>
      </div>
    </td>
  </tr>
  </tbody>
</table>
<div id="user-form" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">{{action == '1' ? '新增' : '修改'}}用户</h4>
      </div>
      <div class="modal-body">
        <form class="form-horizontal" name="myForm">
          <div class="form-group">
            <label class="col-sm-2 control-label">工号 <span style="color: red;">*</span></label>
            <div class="col-sm-10">
              <input type="number" class="form-control" ng-model="userData.worker_num" required>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">名字 <span style="color: red;">*</span></label>
            <div class="col-sm-10">
              <input type="text" class="form-control" ng-model="userData.name" required>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">邮箱 <span style="color: red;">*</span></label>
            <div class="col-sm-10">
              <input type="email" class="form-control" ng-model="userData.email" required>
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary" ng-disabled="myForm.$invalid" ng-click="save()">保存</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->